<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class='container'>
     <div class="tabbable"> <!-- Only required for left/right tabs -->
	<?=$tab_header;?>
       <div class="tab-content" style='height:450px;'>
		 <hr />
         <div class="tab-pane active" id="table1"><?=$this->zetro_auth->allAuth($frm3,'saldo_simpanan');?>
		 <?=$this->zetro_auth->allAuth($list,'saldo_simpanan');?></div>
       </div>
    </div>
<?=$modal;?>    
</div>
<input type='hidden' id='edited' name='edited' value=''/>
<? link_js('jquery.fixedheader','asset/js/');?>
<? //link_js('setup_simpanan','application/zetro_js/');?>
<script languange='javascript'>
$(document).ready(function(e) {
	$('div.tab-content').css({'height':(screen.availHeight-265),'width':(screen.availWidth-230)});
	$('#id_lokasi').html("<?=$lok;?>");
	_show_data();
	($('#id_lokasi').val()=='' || $('#cari').val()=='')?
		$('#prn').attr('disabled','disabled'):$('#prn').removeAttr('disabled');
	//_show_data_anggota('');
	$('#id_lokasi').change(function(){ $('#prn').removeAttr('disabled');_show_data_anggota('1');});
	$('#c_cari').click(function(){ $('#prn').removeAttr('disabled'); _show_data_anggota('1');})
	$('#prn').click(function(){ _print_prev();});
});
function _show_data()
{
	$.post('getjenissimpanan',{'id':''},
	function(result){
		$(result).insertAfter($('#NewList thead tr:last'));
		$('#NewList tbody').html("<tr><td colspan='9'>Silahkan pilih lokasi untuk tampilkan data</td></tr>");
	})
}
function _show_data_anggota(tp)
{
	show_indicator('NewList',9);
	$.post('getsaldosimpanan',$('#frm1').serialize(),function(result)
	{
		$('#NewList tbody').html(result);
		(tp=='')?
		$('#NewList').fixedHeader({'width':(screen.availWidth-50),'height':(screen.availHeight-325)}):'';
	})
}

function _print_prev()
{
	span_indicator('#txt');	
	$.post('printsaldosimpanan',$('#frm1').serialize(),function(result)
	{
		$('#txt').html('');
		$('div#rst').css({'display':'none'});
		$('#prv').attr('src',result);
		$('#PrintPrev .modal-body').css({'width':(screen.availWidth-170),'height':(screen.availHeight-205),'overflow':'auto'});
		$('#PrintPrev')
			.css({'left':'25%','width':(screen.availWidth-150),'height':(screen.availHeight-150)})
			.modal('show');
	})
}
</script>